package br.com.tcc.systemdx.persistence.hibernate;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import br.com.tcc.systemdx.domain.ValorSintoma;
import br.com.tcc.systemdx.persistence.ValorSintomaDAO;

@Repository(ValorSintomaDAO.BEAN_NAME)
@Transactional
public class ValorSintomaHibernateDAOImpl extends
		AbstractEntityHibernateDAOImpl<ValorSintoma> implements ValorSintomaDAO {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4098263296782048120L;

	//@Override
	public List<ValorSintoma> findValoresPossiveisAtributo(Long atributoId) {
		String hql = "select distinct v from ValorSintoma v " +
						"join v.atributos a " +
						"where a.id = :atributoId";
		Query query = _getSession().createQuery(hql);
		query.setLong("atributoId", atributoId);
		return query.list();
	}

}
